<?php
/*
Engineer:  Derek Shue
Secondary: Sean Margison 
Updated: 12/3/2011
Description: Displays searched courses by name, department, year or term.
*/
 ?>


<h3>Courses:</h3>
<dl>


<?php
$this->form->setAction($this->url());
echo $this->form;
?>
<table>
<tr> <th> Course Name </th><th>Department</th></td> <th> Course Number </th> <th> Term </th></tr>
<?php if($this->entries):?>
    <?php foreach ($this->entries as $entry): ?>
    <tr>
	<td align="center"><a href="<?echo $this->url(array('controller'=>'common','action'=>'viewcoursedetails','cid'=>$this->escape($entry->CID)));?>"><?php echo $this->escape($entry->COURSENAME);?></a></td>
	<td align="center"><?php echo $this->escape($entry->DEPARTMENT);?>
	<td align="center"><?php echo $this->escape($entry->COURSENUMBER);?></td>
	<td align="center"><?php echo $this->escape($entry->TERM);?></td> 
	</tr>
	<?php endforeach ?>
<?php endif; ?>
<?php if(!$this->entries):?>
	<tr>
		<td colspan = "4" align = "center"> No courses exist for this term. </td>
	</tr>	
<?php endif; ?>
	</table>
</dl>

